package com.sxpro;
import java.util.ArrayList;
import java.util.List;

//TIP 要<b>运行</b>代码，请按 <shortcut actionId="Run"/> 或
// 点击装订区域中的 <icon src="AllIcons.Actions.Execute"/> 图标。
public class Main {
    public static void main(String[] args) {
        //TIP 当文本光标位于高亮显示的文本处时按 <shortcut actionId="ShowIntentionActions"/>
        // 查看 IntelliJ IDEA 建议如何修正。
        System.out.printf("Hello and welcome!");
    }
}

class Building {
    private String name;

    public Building(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }
}

class Course {
    private String courseName;
    private Building building; // 课程必须在某个建筑中进行

    public Course(String courseName, Building building) {
        this.courseName = courseName;
        this.building = building;
    }

    public String getCourseName() {
        return courseName;
    }

    public Building getBuilding() {
        return building;
    }
}

class College {
    private List<Building> buildings; // 聚合关系，建筑构成学院
    private List<Course> courses; // 组合关系，课程属于学院

    public College() {
        this.buildings = new ArrayList<>();
        this.courses = new ArrayList<>();
    }

    public void addBuilding(Building building) {
        buildings.add(building);
    }

    public void addCourse(Course course) {
        courses.add(course);
    }

    public List<Building> getBuildings() {
        return buildings;
    }

    public List<Course> getCourses() {
        return courses;
    }
}